﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace coliseu.BussinessLayer
{
    public class Fornecedor_ContatoBL
    {
        private coliseuEntities cEntities;

        public Fornecedor_ContatoBL()
        {
            cEntities = new coliseuEntities(Properties.Settings.Default.conn_coliseu);
        }

        public List<fornecedor_contato> selecionar(int id_fornecedor)
        {
            return (from x in cEntities.fornecedor_contato where x.id_fornecedor == id_fornecedor select x).ToList();
        }

        public void salvar(fornecedor_contato b)
        {
            cEntities.AddTofornecedor_contato(b);
            cEntities.SaveChanges();
        }

        public void excluir(fornecedor_contato b)
        {
            cEntities.fornecedor_contato.DeleteObject(b);
            cEntities.SaveChanges();
        }
    }
}
